{template 'common/header'}
{template 'nav'}
<div class="main">

	<form action="" method="post" class="form-horizontal form"
		enctype="multipart/form-data">

		<div class="panel panel-default">
			<div class="panel-heading">
				统计报表
			</div>
			<div class="panel-body">

				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">平台总人数</label>
					<div class="col-sm-9 col-xs-12">
						{$total} 人
					</div>
				</div>

				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">平台总活动数</label>
					<div class="col-sm-9 col-xs-12">
						{$hd} 次
					</div>
				</div>

				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">平台总参与数</label>
					<div class="col-sm-9 col-xs-12">
						{$cy} 次
					</div>
				</div>

				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">平台总评论数</label>
					<div class="col-sm-9 col-xs-12">
						{$pl} 次
					</div>
				</div>

				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">平台总赞数</label>
					<div class="col-sm-9 col-xs-12">
						{$zan} 次
					</div>
				</div>

				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">平台总成功报名数</label>
					<div class="col-sm-9 col-xs-12">
						{$success} 人
					</div>
				</div>


			</div>
		</div>
	</form>

	<div id="main" style="height:400px;width:80%;margin-left:10%;padding-top:50px"></div>
	<div id="main2" style="height:400px;width:80%;margin-left:10%;padding-top:50px"></div>
	<div id="main3" style="height:400px;width:80%;margin-left:10%;padding-top:50px"></div>
	<div id="main4" style="height:400px;width:80%;margin-left:10%;padding-top:50px"></div>

	 <!-- ECharts单文件引入 -->
    <script src="http://echarts.baidu.com/build/dist/echarts.js"></script>
    <script type="text/javascript">
        // 路径配置
        require.config({
            paths: {
                echarts: 'http://echarts.baidu.com/build/dist'
            }
        });

        // 使用
        require(
            [
                'echarts',
                'echarts/chart/pie', // 使用柱状图就加载pie模块，按需加载
                'echarts/chart/funnel'
            ],
            function (ec) {
                // 基于准备好的dom，初始化echarts图表
                var myChart = ec.init(document.getElementById('main'));
                var myChart2 = ec.init(document.getElementById('main2'));
                var myChart3 = ec.init(document.getElementById('main3'));
                var myChart4 = ec.init(document.getElementById('main4'));

                var option = {
                    title : {
                        text: '活动参与排行数据',
                        subtext: '统计报表',
                        x:'center'
                    },
                    tooltip : {
                        trigger: 'item',
                        formatter: "{a} <br/>{b} : {c} ({d}%)"
                    },
                    legend: {
                        orient : 'vertical',
                        x : 'left',
                        data:[
                            {loop $list $item}
                            '{$item['title']}',
                            {/loop}
                            ]
                    },
                    toolbox: {
                        show : true,
                        feature : {
                            mark : {show: false},
                            dataView : {show: false, readOnly: false},
                            magicType : {
                                show: true,
                                type: ['pie', 'funnel'],

                                option: {
                                    funnel: {
                                        x: '25%',
                                        width: '50%',
                                        funnelAlign: 'left',
                                        max: 1548
                                    }
                                }
                            },
                            restore : {show: true},
                            saveAsImage : {show: true}
                        }
                    },
                    calculable : true,
                    series : [
                        {
                            name:'活动参与排行数据',
                            type:'pie',
                            radius : '55%',
                            center: ['50%', '60%'],
                            data:[
                            {loop $list $item}
                                {value:{$item['num2']}, name:'{$item['title']}'},
                            {/loop}
                            ]
                        }
                    ]
                };

                var option2 = {
                    title : {
                        text: '活动评论排行数据',
                        subtext: '统计报表',
                        x:'center'
                    },
                    tooltip : {
                        trigger: 'item',
                        formatter: "{a} <br/>{b} : {c} ({d}%)"
                    },
                    legend: {
                        orient : 'vertical',
                        x : 'left',
                        data:[
                            {loop $list2 $item}
                            '{$item['title']}',
                            {/loop}
                            ]
                    },
                    toolbox: {
                        show : true,
                        feature : {
                            mark : {show: false},
                            dataView : {show: false, readOnly: false},
                            magicType : {
                                show: true,
                                type: ['pie', 'funnel'],

                                option: {
                                    funnel: {
                                        x: '25%',
                                        width: '50%',
                                        funnelAlign: 'left',
                                        max: 1548
                                    }
                                }
                            },
                            restore : {show: true},
                            saveAsImage : {show: true}
                        }
                    },
                    calculable : true,
                    series : [
                        {
                            name:'活动评论排行数据',
                            type:'pie',
                            radius : '55%',
                            center: ['50%', '60%'],
                            data:[
                            {loop $list2 $item}
                                {value:{$item['num2']}, name:'{$item['title']}'},
                            {/loop}
                            ]
                        }
                    ]
                };

                var option3 = {
                    title : {
                        text: '评论点赞排行数据',
                        subtext: '统计报表',
                        x:'center'
                    },
                    tooltip : {
                        trigger: 'item',
                        formatter: "{a} <br/>{b} : {c} ({d}%)"
                    },
                    legend: {
                        orient : 'vertical',
                        x : 'left',
                        data:[
                            {loop $list3 $item}
                            '{$item['title']}',
                            {/loop}
                            ]
                    },
                    toolbox: {
                        show : true,
                        feature : {
                            mark : {show: false},
                            dataView : {show: false, readOnly: false},
                            magicType : {
                                show: true,
                                type: ['pie', 'funnel'],

                                option: {
                                    funnel: {
                                        x: '25%',
                                        width: '50%',
                                        funnelAlign: 'left',
                                        max: 1548
                                    }
                                }
                            },
                            restore : {show: true},
                            saveAsImage : {show: true}
                        }
                    },
                    calculable : true,
                    series : [
                        {
                            name:'评论点赞排行数据',
                            type:'pie',
                            radius : '55%',
                            center: ['50%', '60%'],
                            data:[
                            {loop $list3 $item}
                                {value:{$item['num2']}, name:'{$item['title']}'},
                            {/loop}
                            ]
                        }
                    ]
                };

                var option4 = {
                    title : {
                        text: '用户参与排行数据',
                        subtext: '统计报表',
                        x:'center'
                    },
                    tooltip : {
                        trigger: 'item',
                        formatter: "{a} <br/>{b} : {c} ({d}%)"
                    },
                    legend: {
                        orient : 'vertical',
                        x : 'left',
                        data:[
                            {loop $list4 $item}
                            '{$item['title']}',
                            {/loop}
                            ]
                    },
                    toolbox: {
                        show : true,
                        feature : {
                            mark : {show: false},
                            dataView : {show: false, readOnly: false},
                            magicType : {
                                show: true,
                                type: ['pie', 'funnel'],

                                option: {
                                    funnel: {
                                        x: '25%',
                                        width: '50%',
                                        funnelAlign: 'left',
                                        max: 1548
                                    }
                                }
                            },
                            restore : {show: true},
                            saveAsImage : {show: true}
                        }
                    },
                    calculable : true,
                    series : [
                        {
                            name:'用户参与排行数据',
                            type:'pie',
                            radius : '55%',
                            center: ['50%', '60%'],
                            data:[
                            {loop $list4 $item}
                                {value:{$item['num2']}, name:'{$item['title']}'},
                            {/loop}
                            ]
                        }
                    ]
                };


                // 为echarts对象加载数据
                myChart.setOption(option);
                myChart2.setOption(option2);
                myChart3.setOption(option3);
                myChart4.setOption(option4);
            }
        );
    </script>
</div>

